<html xmlns="http://www.w3.org/1999/xhtml"><head><title>Clojure documentation browser</title><style>
.library
{
  padding: 0.5em 0 0 0 
}
.all-libs-toggle,.library-contents-toggle
{
 font-size: small;
}
.all-libs-toggle a,.library-contents-toggle a
{
 color: white
}
.library-member-doc-whitespace
{
 white-space: pre
}
.library-member-source-toggle
{
  font-size: small;
  margin-top: 0.5em
}
.library-member-source
{
  display: none;
  border-left: solid lightblue 
}
.library-member-docs
{
  font-family:monospace
}
.library-member-arglists
{
  font-family: monospace
}
.library-member-type
{
  font-weight: bold; 
  font-size: small;
  font-style: italic;
  color: darkred
}
.lib-links
{
  margin: 0 0 1em 0
}

.lib-link-header
{
  color: white;
  background: darkgreen;
  width: 100%
}

.library-name 
{ 
  color: white;
  background: darkblue;
  width: 100%
}

.missing-library
{
  color: darkred; 
  margin: 0 0 1em 0 
}

.library-members
{
  list-style: none
}

.library-member-name
{
  font-weight: bold;
  font-size: 105%
}</style><script language="JavaScript" type="text/javascript"> // <![CDATA[

function getElem(id)
{
  if( document.getElementById )
  {
    return document.getElementById( id )
  }
  else if ( document.all )
  {
    return eval( 'document.all.' + id )
  }
  else
    return false;
}

function setDisplayStyle(id,displayStyle)
{
  var elem = getElem (id)
  if (elem)
  {
    elem.style.display = displayStyle
  }

}

function setLinkToggleText (id, text)
{
 var elem = getElem (id)
 if (elem)
 {
   elem.innerHTML = text
 }
}

function collapse(id)
{
  setDisplayStyle (id, 'none')
}

function expand (id)
{
  setDisplayStyle (id, 'block')
}

function toggleSource( id )
{
  toggle(id, 'linkto-' + id, 'Hide Source', 'Show Source')
}

function toggle(targetid, linkid, textWhenOpen, textWhenClosed)
{
  var elem = getElem (targetid)
  var link = getElem (linkid)

  if (elem && link)
  {
    var isOpen = false
    if (elem.style.display == '')
    {
      isOpen = link.innerHTML == textWhenOpen
    }
    else if( elem.style.display == 'block' )
    {
      isOpen = true
    }
    
    if (isOpen)
    {
      elem.style.display = 'none'
      link.innerHTML = textWhenClosed
    }
    else
    {
      elem.style.display = 'block'
      link.innerHTML = textWhenOpen
    }
  }
}

      //]]>
</script><script language="JavaScript" type="text/javascript">// <![CDATA[!
function expandAllNamespaces()
{
expand(&apos;library-contents-client.client&apos;);
setLinkToggleText(&apos;library-contents-toggle-client.client&apos;, &apos;-&apos;);

}function collapseAllNamespaces()
{
collapse(&apos;library-contents-client.client&apos;);
setLinkToggleText(&apos;library-contents-toggle-client.client&apos;, &apos;+&apos;);

}
// ]]></script></head><body><div class="lib-links"><div class="lib-link-header">Namespaces<span class="all-libs-toggle"> [ <a href="javascript:expandAllNamespaces()">Expand All</a> ] [ <a href="javascript:collapseAllNamespaces()">Collapse All</a> ]</span></div><a class="lib-link" href="#library-client.client">client.client</a></div><div class="library"><a name="library-client.client"/><div class="library-name"><span class="library-contents-toggle">[ <a id="library-contents-toggle-client.client" href="javascript:toggle(&apos;library-contents-client.client&apos;, &apos;library-contents-toggle-client.client&apos;, &apos;-&apos;, &apos;+&apos;)">-</a> ] </span>client.client</div><div class="library-contents" id="library-contents-client.client"><div class="library-member-links"><a class="lib-member-link" href="#member-client.client-*host*">*host*</a> <a class="lib-member-link" href="#member-client.client-*port*">*port*</a> <a class="lib-member-link" href="#member-client.client-connection-test">connection-test</a> <a class="lib-member-link" href="#member-client.client-create-net">create-net</a> <a class="lib-member-link" href="#member-client.client-delete-net">delete-net</a> <a class="lib-member-link" href="#member-client.client-describe-net">describe-net</a> <a class="lib-member-link" href="#member-client.client-out-of-date-net">out-of-date-net</a> <a class="lib-member-link" href="#member-client.client-select-net">select-net</a> <a class="lib-member-link" href="#member-client.client-serialize-client">serialize-client</a> <a class="lib-member-link" href="#member-client.client-unserialize">unserialize</a> <a class="lib-member-link" href="#member-client.client-update-net">update-net</a> <a class="lib-member-link" href="#member-client.client-where-to">where-to</a></div><ol class="library-members"><li class="library-member"><a name="member-client.client-*host*"/><dl class="library-member-table"><dt class="library-member-name">*host*</dt><dd><div class="library-member-info"><span class="library-member-type">var</span> <span class="library-member-arglists"></span></div><div class="library-member-docs"/><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-*host*&apos;)" id="linkto-membersource-client.client-*host*">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-*host*"><pre>(def *host* (ref &quot;localhost&quot;))</pre></div></div></dd></dl></li><li class="library-member"><a name="member-client.client-*port*"/><dl class="library-member-table"><dt class="library-member-name">*port*</dt><dd><div class="library-member-info"><span class="library-member-type">var</span> <span class="library-member-arglists"></span></div><div class="library-member-docs"/><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-*port*&apos;)" id="linkto-membersource-client.client-*port*">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-*port*"><pre>(def *port* (ref 3009))</pre></div></div></dd></dl></li><li class="library-member"><a name="member-client.client-connection-test"/><dl class="library-member-table"><dt class="library-member-name">connection-test</dt><dd><div class="library-member-info"><span class="library-member-type">fn</span> <span class="library-member-arglists">([])</span></div><div class="library-member-docs"><div class="library-member-doc-line">Tests the connection</div></div><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-connection-test&apos;)" id="linkto-membersource-client.client-connection-test">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-connection-test"><pre>(defn connection-test
  &quot;Tests the connection&quot;
  []
  (let [socket (Socket. @*host* @*port*)]
    (with-open [input (BufferedReader. (InputStreamReader. (.getInputStream socket)))
		output (PrintWriter. (.getOutputStream socket))]
      (.println output &quot;test-db&quot;)
      (.println output &quot;test&quot;)
      (.flush output)
      (println (.readLine input)))))</pre></div></div></dd></dl></li><li class="library-member"><a name="member-client.client-create-net"/><dl class="library-member-table"><dt class="library-member-name">create-net</dt><dd><div class="library-member-info"><span class="library-member-type">fn</span> <span class="library-member-arglists">([database entry])</span></div><div class="library-member-docs"><div class="library-member-doc-line">Ask the server to send the records</div></div><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-create-net&apos;)" id="linkto-membersource-client.client-create-net">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-create-net"><pre>(defn create-net
  &quot;Ask the server to send the records&quot;
  [database entry]
  (let [socket (Socket. @*host* @*port*)]
    (with-open [input (BufferedReader. (InputStreamReader. (.getInputStream socket)))
		output (PrintWriter. (.getOutputStream socket))]
      (.println output (serialize-client [database entry]))
      (.println output &quot;create&quot;)
      (.flush output)
      )))</pre></div></div></dd></dl></li><li class="library-member"><a name="member-client.client-delete-net"/><dl class="library-member-table"><dt class="library-member-name">delete-net</dt><dd><div class="library-member-info"><span class="library-member-type">fn</span> <span class="library-member-arglists">([database recno])</span></div><div class="library-member-docs"><div class="library-member-doc-line">Ask the server to send the records</div></div><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-delete-net&apos;)" id="linkto-membersource-client.client-delete-net">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-delete-net"><pre>(defn delete-net
  &quot;Ask the server to send the records&quot;
  [database recno]
  (let [socket (Socket. @*host* @*port*)]
    (with-open [input (BufferedReader. (InputStreamReader. (.getInputStream socket)))
		output (PrintWriter. (.getOutputStream socket))]
      (.println output (serialize-client [database recno]))
      (.println output &quot;delete&quot;)
      (.flush output)
      ))
  )</pre></div></div></dd></dl></li><li class="library-member"><a name="member-client.client-describe-net"/><dl class="library-member-table"><dt class="library-member-name">describe-net</dt><dd><div class="library-member-info"><span class="library-member-type">fn</span> <span class="library-member-arglists">([database])</span></div><div class="library-member-docs"><div class="library-member-doc-line">Ask the server to describe the indicated database</div></div><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-describe-net&apos;)" id="linkto-membersource-client.client-describe-net">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-describe-net"><pre>(defn describe-net
  &quot;Ask the server to describe the indicated database&quot;
  [database]
  (let [socket (Socket. @*host* @*port*)]
    (with-open [input (BufferedReader. (InputStreamReader. (.getInputStream socket)))
		output (PrintWriter. (.getOutputStream socket))]
      (.println output database)
      (.println output &quot;describe&quot;)
      (.flush output)
      (read-string (.readLine input)))))</pre></div></div></dd></dl></li><li class="library-member"><a name="member-client.client-out-of-date-net"/><dl class="library-member-table"><dt class="library-member-name">out-of-date-net</dt><dd><div class="library-member-info"><span class="library-member-type">fn</span> <span class="library-member-arglists">([database hashRec])</span></div><div class="library-member-docs"><div class="library-member-doc-line">Checks with the server if the current database is up-to-date</div></div><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-out-of-date-net&apos;)" id="linkto-membersource-client.client-out-of-date-net">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-out-of-date-net"><pre>(defn out-of-date-net 
  &quot;Checks with the server if the current database is up-to-date&quot;
  [database hashRec]
  (let [socket (Socket. @*host* @*port*)]
    (with-open [input (BufferedReader. (InputStreamReader. (.getInputStream socket)))
		output (PrintWriter. (.getOutputStream socket))]
      (.println output (serialize-client [database hashRec]))
		(.println output &quot;out-of-date&quot;)
		(.flush output)
		(str (read-string (.readLine input)))
		)))</pre></div></div></dd></dl></li><li class="library-member"><a name="member-client.client-select-net"/><dl class="library-member-table"><dt class="library-member-name">select-net</dt><dd><div class="library-member-info"><span class="library-member-type">fn</span> <span class="library-member-arglists">([database])</span></div><div class="library-member-docs"><div class="library-member-doc-line">Ask the server to send the records</div></div><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-select-net&apos;)" id="linkto-membersource-client.client-select-net">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-select-net"><pre>(defn select-net
  &quot;Ask the server to send the records&quot;
  [database]
  (let [socket (Socket. @*host* @*port*)]
    (with-open [input (BufferedReader. (InputStreamReader. (.getInputStream socket)))
		output (PrintWriter. (.getOutputStream socket))]
      (.println output database)
      (.println output &quot;select&quot;)
      (.flush output)
      (read-string (.readLine input))
      )))</pre></div></div></dd></dl></li><li class="library-member"><a name="member-client.client-serialize-client"/><dl class="library-member-table"><dt class="library-member-name">serialize-client</dt><dd><div class="library-member-info"><span class="library-member-type">fn</span> <span class="library-member-arglists">([data])</span></div><div class="library-member-docs"><div class="library-member-doc-line">Converts structures into strings</div></div><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-serialize-client&apos;)" id="linkto-membersource-client.client-serialize-client">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-serialize-client"><pre>(defn serialize-client
	&quot;Converts structures into strings&quot;
	[data]
	(binding[*print-dup* true]
  		(print-str data))
)</pre></div></div></dd></dl></li><li class="library-member"><a name="member-client.client-unserialize"/><dl class="library-member-table"><dt class="library-member-name">unserialize</dt><dd><div class="library-member-info"><span class="library-member-type">fn</span> <span class="library-member-arglists">([data])</span></div><div class="library-member-docs"><div class="library-member-doc-line">Method that interprets a string</div></div><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-unserialize&apos;)" id="linkto-membersource-client.client-unserialize">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-unserialize"><pre>(defn unserialize
  &quot;Method that interprets a string&quot;
  [data]
  (read-string data))</pre></div></div></dd></dl></li><li class="library-member"><a name="member-client.client-update-net"/><dl class="library-member-table"><dt class="library-member-name">update-net</dt><dd><div class="library-member-info"><span class="library-member-type">fn</span> <span class="library-member-arglists">([database num entry])</span></div><div class="library-member-docs"><div class="library-member-doc-line">Ask the server to create a record</div></div><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-update-net&apos;)" id="linkto-membersource-client.client-update-net">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-update-net"><pre>(defn update-net
  &quot;Ask the server to create a record&quot;
  [database num entry]
  (let [socket (Socket. @*host* @*port*)]
    (with-open [input (BufferedReader. (InputStreamReader. (.getInputStream socket)))
		output (PrintWriter. (.getOutputStream socket))]
      (.println output (serialize-client [database num entry]))
      (.println output &quot;update&quot;)
      (.flush output)))
  )</pre></div></div></dd></dl></li><li class="library-member"><a name="member-client.client-where-to"/><dl class="library-member-table"><dt class="library-member-name">where-to</dt><dd><div class="library-member-info"><span class="library-member-type">fn</span> <span class="library-member-arglists">([port host])</span></div><div class="library-member-docs"><div class="library-member-doc-line">Gives the client the port and the host where it will connect</div></div><div class="library-member-source-section"><div class="library-member-source-toggle">[ <a href="javascript:toggleSource(&apos;membersource-client.client-where-to&apos;)" id="linkto-membersource-client.client-where-to">Show Source</a> ]</div><div class="library-member-source" id="membersource-client.client-where-to"><pre>(defn where-to
  &quot;Gives the client the port and the host where it will connect&quot;
  [port host]
  (dosync (ref-set *port* port))
  (dosync (ref-set *host* host)))</pre></div></div></dd></dl></li></ol></div></div></body></html>